﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ValidationControl.aspx.cs" Inherits="ValidationControl" %>

<%@ Register src="UserControl/TimeControl.ascx" tagname="TimeControl" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Validation Control</title>
    <script type="text/javascript">
    
      function pageLoad() {
      }
    
    </script>
    <style type="text/css">
        .style1
        {
            width: 640px;
        }
        .style2
        {
            width: 168px;
        }
        .style3
        {
            width: 169px;
        }
        .style4
        {
            width: 168px;
            text-align: right;
        }
        .style5
        {
            width: 185px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <h1>Validation Control</h1>
        <uc1:TimeControl ID="TimeControl1" runat="server" />
       
    </div>
      
      
      
        <b>Please submit your comments<br />
        </b><br />
        <table class="style1">
            <tr>
                <td class="style4">
                    Name:</td>
                <td class="style3">
                    <asp:TextBox ID="TxtName" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:RequiredFieldValidator ID="rvName" runat="server" 
                        ControlToValidate="TxtName" ErrorMessage="Name field required.">*</asp:RequiredFieldValidator>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    EMail Address:</td>
                <td class="style3">
                    <asp:TextBox ID="TxtEmail" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:RequiredFieldValidator ID="rvEmailAddress" runat="server" 
                        ControlToValidate="TxtEmail" ErrorMessage="Email address is required.">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegExpEmailAddress" runat="server" 
                        ControlToValidate="TxtEmail" ErrorMessage="EMailAddress is invalid" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    Subject :</td>
                <td class="style3">
                    <asp:TextBox ID="TxtSubject" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:RequiredFieldValidator ID="rvSubject" runat="server" 
                        ControlToValidate="TxtSubject" ErrorMessage="Subject Field Required.">*</asp:RequiredFieldValidator>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    Comments:</td>
                <td class="style3">
                    <asp:TextBox ID="TxtComments" runat="server" Height="84px" TextMode="MultiLine" 
                        Width="200px"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:RequiredFieldValidator ID="rvComments" runat="server" 
                        ControlToValidate="TxtComments" ErrorMessage="Comments field Required">*</asp:RequiredFieldValidator>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="LblResult" runat="server"  Text=""></asp:Label>
                </td>
                <td class="style3">
                    <asp:Button ID="BtnSubmit" runat="server" Text="Click here to Submit" onserverclick="BtnSubmit_Click" Width="199px"  />
                </td>
                <td class="style5">
                    <asp:ValidationSummary ID="ValidationSummary2" runat="server" 
                        ShowMessageBox="True" ShowSummary="False" />
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <p style="margin-left: 40px">
            &nbsp;</p>
      
      
      
    </div>
    <a href="Default.aspx" >Back</a>
    </form>
</body>
</html>
